package com.shms.service.impl;

import com.shms.bean.GroupOfStudent;
import com.shms.dao.ShStudentDao;
import com.shms.entity.ShStudent;
import com.shms.service.ShStudentService;

/**
 * 文件名：ShStudentServiceImpl.java
 * 编写者：杨勇
 * 创建时间：2013-3-18
 * 简要描述：
 * 
 */
public class ShStudentServiceImpl implements ShStudentService {
	
	private ShStudentDao shStudentDao;
	
	public GroupOfStudent queryStudent(GroupOfStudent groupOfStudent) {
		if (groupOfStudent.getType().equals("forward")) {
			int currentPage = groupOfStudent.getCurrentPage() - 2;
			groupOfStudent.setCurrentPage(currentPage);
		}
		return shStudentDao.queryStudent(groupOfStudent);
	}

	public void setShStudentDao(ShStudentDao shStudentDao) {
		this.shStudentDao = shStudentDao;
	}
	
	public boolean batchDelete(Integer[] nos){
		return this.shStudentDao.batchDelete(nos);
	}
	
	public boolean saveStudent(ShStudent shStudent) {
		return shStudentDao.saveStudent(shStudent);
	}
	
	public boolean updateStudent(ShStudent shStudent) {
		return shStudentDao.updateStudent(shStudent);
	}
	
	public boolean checkStudent(ShStudent shStudent) {
		return shStudentDao.checkStudent(shStudent);
	}
	
	public ShStudent queryByNo(ShStudent shStudent) {
		return shStudentDao.queryByNo(shStudent);
	}
}
